﻿<%@ Page Language="C#" Inherits="E.Web.Teacher.internals.surveysetting.CertificateEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
  <title>认证或项目问卷调查管理</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  <link rel="stylesheet" href="/css/main.css" type="text/css" media="all" />
  <link rel="stylesheet" href="/css/t_main.css" type="text/css" media="all" />
  <script type="text/javascript" src="/js/Common.js"></script>
  <script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
  <script type="text/javascript">
    window.onload = function() {
      document.getElementById("form1").style.display = "";
    }
    function CheckForm(act) {
      var err = false;

      if (act == "n" && document.getElementById("CertificateSlt").value == "-1") {
        alert("请选择认证或项目");
        err = true;
      }

      var optionArr = [];
      var isChecked = false;
      var optionList = document.getElementsByName("OptionChb");
      for (var i = 0; i < optionList.length; i++) {
        if ($("#OptionChb_" + i)[0].checked) {
          isChecked = true;
          optionArr.push($("#OptionChb_" + i).val());
        }
      }

      if (!isChecked) {
        alert("请至少选择一个选项");
        err = true;
      }

      $("#option_v").val(optionArr);

      if (err) {
        return false;
      } else {
        return true;
      }
    }
  </script>
  <style type="text/css">
    .left_2{ line-height:20px; _line-height:23px; }
    .c_chb{ margin-top:2px; _margin-top:3px; }
    ul li .d{ width:400px; display:table; }
  </style>
</head>
<body>
  <form id="form1" method="post" action="" style="display:none;">
    <div class="m_top"></div>
    <div class="block_2">
      <div style="width:650px; height:22px;">
        <div class="title">&nbsp;认证或项目问卷调查管理</div>
      </div>
      <div class="spe_line_2"></div>
      <% if (act == "n") { %>
      <div class="box_1">
        <div class="fl tr left"><span class="hint">*</span>认证或项目：</div>
        <div class="fl">
          <select id="CertificateSlt" name="CertificateSlt">
            <option value="-1">请选择</option>
            <% foreach (System.Collections.Generic.KeyValuePair<int, string> kvp in certificateList) { %>
            <option value="<%=kvp.Key %>"><%=kvp.Value %></option>
            <% } %>
          </select>
        </div>
      </div>
      <% } else { %>
      <div class="box_1">
        <div class="fl tr left">课程：</div>
        <div class="fl" style="line-height:20px; _line-height:23px;"><%=model.CName %></div>
      </div>
      <% } %>
      
      <div class="box_1">
        <div class="fl tr left"><span class="hint">*</span>选项：</div>
        <div class="fl">
          <ul style="width:400px;">
          <% if (optionList != null && optionList.Count > 0) { %>
            <% int i = 0; %>
            <% foreach (System.Collections.Generic.KeyValuePair<int, string> kvp in optionList) { %>
            <li><div class="d"><input type="checkbox" id="OptionChb_<%=i %>" name="OptionChb" class="fl c_chb" value="<%=kvp.Key %>" /><div class="fl left_2">&nbsp;<%=kvp.Value %></div></div></li>
            <% i++; %>
            <% } %>
          <% } %>
          </ul>
        </div>
      </div>
      
      <input type="hidden" id="act" name="act" value="<%=act %>" />
      <input type="hidden" id="id" name="id" value="<%=id %>" />
      <input type="hidden" id="chk_v" name="chk_v" />
      <input type="hidden" id="option_v" name="option_v" value="<%=option_v %>" />
      <div style="width:350px; margin-top:20px; text-align:center;">
        <input type="image" src="/images/btn/confirm.gif" style="width:52px; height:22px;" onclick="return CheckForm('<%=act %>');" />
        &nbsp;&nbsp;<a href="/internals/surveysetting/CertificateList.aspx"><img alt="" src="/images/btn/back.gif" /></a>
      </div>
    </div>
    
      <% if (act == "u") { %>
    <script type="text/javascript">
      InitCheckBoxData("option_v","OptionChb","OptionChb_");      
    </script>
      <% } %>
  </form>
</body>
</html>
